<!-- include tpl=head menutitle=$page_rs.title -->
<!-- if $page_rs.banner -->
<div class="banner" style="background-image:url('{$page_rs.banner.filename}');"><img src="{#images#}/blank.gif" alt="{$page_rs.title}" /></div>
<!-- /if -->
<script type="text/javascript">
$(document).ready(function(){
	$("#book_post").submit(function(){
		//提交表单
		if(!$('#title').val()){
			$.dialog.alert("留言主题不能为空");
			return false;
		}
		if(!$('#fullname').val()){
			$.dialog.alert('留言人姓名不能为空');
			return false;
		}
		if(!$('#email').val()){
			$.dialog.alert('邮箱不能为空');
			return false;
		}
		var content = UE.getEditor('content').getContentTxt();
		if(!content){
			$.dialog.alert('留言内容不能为空');
			return false;
		}
		$(this).ajaxSubmit({
			'url':api_url('post','save'),
			'type':'post',
			'dataType':'json',
			'success':function(rs){
				if(rs.status == 'ok'){
					$.dialog.alert('您的留言信息已发布，请耐心等候管理员审核，感谢您的提交',function(){
						$.phpok.reload();
					},'succeed');
				}else{
					$.dialog.alert(rs.content,function(){
						$("#update_vcode").phpok_vcode();
						$("#_chkcode").val('');
					});
					return false;
				}
			}
		});
		return false;
	});
});
</script>
<div class="main">
	<!-- include tpl=block/breadcrumb -->
	<div class="am-panel-group">
		<div class="am-panel am-panel-default">
			<div class="am-panel-hd">发布新留言</div>
			<div class="am-panel-bd">
				<form method="post" id="book_post" class="am-form">
				<input type="hidden" name="id" id="id" value="{$page_rs.identifier}" />
				<!-- fields pid=$page_rs.id fields_format=1 in_title=1 -->
				<!-- loop from=$list key=$key value=$value -->
				<div class="am-g am-form-group">
					<label class="am-u-sm-2" for="{$value.identifier}">{$value.title}</label>
					<div class="am-u-sm-10">{$value.html}</div>
				</div>
				<!-- /loop -->
				<!-- if $sys.is_vcode && function_exists("imagecreate") -->
				<div class="am-g am-form-group">
					<label class="am-u-sm-2" for="_chkcode">验证码</label>
					<div class="am-u-sm-4"><input type="text" name="_chkcode" id="_chkcode" class="vcode" /></div>
					<div class="am-u-sm-6"><img src="" border="0" align="absmiddle" id="update_vcode" class="hand"></div>
					<script type="text/javascript">
					$(document).ready(function(){
						$("#update_vcode").phpok_vcode();
						//更新点击时操作
						$("#update_vcode").click(function(){
							$(this).phpok_vcode();
						});
					});
					</script>
				</div>
				<!-- /if -->
				<div class="am-g am-form-group">
					<div class="am-u-sm-2">&nbsp;</div>
					<div class="am-u-sm-10"><input type="submit" value=" 提交 " class="am-btn am-btn-primary" /></div>
				</div>
				
				</form>
			</div>
		</div>

		<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
		<div class="am-panel am-panel-default">
			<div class="am-panel-hd">{$value.title}<small class="am-fr gray">发布时间：{func time_format $value.dateline}</small></div>
			<div class="am-panel-bd">
				<div class="content">
					{$value.content}
					<!-- if $value.pic -->
					<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-bordered" data-am-gallery="{  }">
						<!-- loop from=$value.pic key=$k value=$v id=$idxx -->
						<li><div class="am-gallery-item"><a href="{$v.gd.auto}" target="_blank"><img src="{$v.gd.thumb}" /></a></div></li>
						<!-- /loop -->
					</ul>
					<!-- /if -->
				</div>
				<!-- if $value.adm_reply -->
				<div class="adm_reply"><div class="adminer">管理员回复：</div>{$value.adm_reply}</div>
				<!-- /if -->
			</div>
		</div>
		<!-- /loop -->
		<!-- include tpl=block/pagelist -->
	</div>
</div>
<!-- include tpl=foot -->